<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/formdiv.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var grouplist_js_powername_empty  = "[%$ST.grouplist_js_powername_empty%]";
	var grouplist_js_edit_ok = "[%$ST.grouplist_js_edit_ok%]";
	var grouplist_js_edit_no = "[%$ST.grouplist_js_edit_no%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.managebottonadd').css({height:h-40});
		var options = {

			beforeSubmit: formverify,

			success:saveResponse,
			resetForm: false
		}
		$('#poweredit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['powername']==""){
			document.poweredit.powername.focus();
			alert(grouplist_js_powername_empty);
			return false;
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(grouplist_js_edit_ok);
		}else{
			alert(grouplist_js_edit_no);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="poweredit" id="poweredit" method="post" action="index.php?archive=powergroup&action=powerlistsava">
<input type="hidden" name="inputclass" value="edit">
<input type="hidden" name="id" value="[%$groupinfo.id%]">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.grouplist_edit_mess%]<u>[%$groupinfo.powername%]</u></span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.grouplist_add_powername%]</td>
						<td class="trtitle02"><input type="text" name="powername" size="25" maxlength="20" value="[%$groupinfo.powername%]" class="infoInput"/> <span class="cautiontitle">[%$ST.grouplist_add_powername_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.grouplist_add_powerlist%]</td>
						<td class="trtitle02">
							<table width="100%" border="0" cellspacing="0" cellpadding="2">
							[%forlist from=$powermenulist key=list%]
								<tr>
									<td colspan="4" style="padding:5px 5px 5px 0px;">
										<input type="checkbox" name="powerlist[]" [%if in_array($powermenulist[list].loadfun , $powerlist)%]CHECKED[%/if%] value="[%$powermenulist[list].loadfun%]" id="powerlist">
										<b>[%$powermenulist[list].menuname%]</b>  <span class="cautiontitle">[%$ST.grouplist_add_powerlist_mess%]</span>
									</td>
								</tr>
								[%forlist from=$powermenulist[list].menu key=i%]
								<tr>
									<td colspan="1" style="padding:5px 5px 5px 0px;" valign="top">
										<input type="checkbox" name="powerlist[]" [%if in_array($powermenulist[list].menu[i].loadfun , $powerlist)%]CHECKED[%/if%] value="[%$powermenulist[list].menu[i].loadfun%]" id="powerlist"> [%$powermenulist[list].menu[i].menuname%]
									</td>
									<td colspan="3">
										<table border="0" cellspacing="0" cellpadding="2">
											<tr>
											[%forlist from=$powermenulist[list].menu[i].linked key=ii%]
											<td style="padding:5px 5px 5px 0px;">
												<input type="checkbox" name="powerlist[]" [%if in_array($powermenulist[list].menu[i].linked[ii].loadfun , $powerlist)%]CHECKED[%/if%] value="[%$powermenulist[list].menu[i].linked[ii].loadfun%]" id="powerlist"> [%$powermenulist[list].menu[i].linked[ii].menuname%]
											</td>
											[%div=>ii=4%]</tr><tr>[%/div=>ii%]
											[%/forlist%]
											</tr>
										</table>
									</td>
								</tr>
								[%/forlist%]
								<tr>
									<td colspan="4"><hr></td>
								</tr>
							[%/forlist%]
							</table>
						</td>
					</tr>
					<tr>
						<td colspan="2"></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" id="submitbotton" name="Submit" value="[%$ST.botton_edit%]" class="button orange" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_edit_reset%]" class="button orange" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>      